package com.mxpio.erp.common.plm.entity;

import com.mxpioframework.jpa.annotation.DictAble;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.Dept;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "V_MB_ERP_PLM_PROJECT_OVERDUE")
@Schema(description="项目逾期时长数量分布")
public class VEProjectOverdue implements DictAble, Serializable {

//    @Id
//    @Generator
//    @Column(name = "ID_", updatable = false)
//    @Schema(description = "ID")
//    private String id;
    @Id
    @Schema(description = "逾期天数类型")
    @Column(name = "OVERDUE_DAY_TYPE_")
    private String overdueDayType;

    @Column(name = "INFO_DEPT_ID_")
    @Schema(description = "项目所属部门")
    @Dict(dicCode = "deptCode", dicEntity = Dept.class, dicText = "deptName")
    private String infoDeptId;

    @Column(name = "NUM_")
    @Schema(description = "数量")
    private long num;

    @Transient
    private Map<String, String> textMap;
    public String putText(String key, String value) {
        if (textMap == null) {
            textMap = new HashMap<>();
        }
        return textMap.put(key, value);
    }
}

